<template>
  <div @click="quit" class="quit">
    <img src="../assets/tuichu@3x.png" alt="" />
  </div>
</template>
<script>
import { removeToken } from "@/utils/auth";
import router from "@/router";
import { Dialog } from "vant";
export default {
  methods: {
    //是否退出系统
    quit() {
      // const answer = window.confirm('是否退出系统?')
      // if (answer) {
      //   removeToken()
      //   router.push('/login')
      // }
      Dialog.confirm({
        title: "",
        message: "是否退出系统?",
        confirmButtonColor: "#009966",
      })
        .then(() => {
          // on confirm
          removeToken();
          router.push("/login");
        })
        .catch(() => {
          // on cancel
        });
    },
  },
};
</script>
<style lang="less">
.quit {
  position: fixed;
  right: 21px;
  bottom: calc(81px + env(safe-area-inset-bottom));
  width: 46px;
  height: 46px;
  background: #bdbec6;
  box-shadow: 0 5px 10px rgba(143, 146, 161, 0.26);
  border-radius: 50%;
  img {
    width: 100%;
  }
}
</style>